Public Sub ResizeInitMDI(Optional Index As Integer)
'ReLoad Each Controls Tag Property with its aspect ratio
'(control positions to the form Scale Properties)
'NOTE: This routine needs to be called anytime  a new Control is added/deleted at runtime

   On Error Resume Next

    Dim objForm As Form
    
    '-----------
    
    Set objForm = frmChild(Index)
    
    For Each ctl In objForm
       ctl.Tag = sEMPTY
       ctl.Tag = (ctl.Left / objForm.ScaleWidth) & vbTab & (ctl.Top / objForm.ScaleHeight) & vbTab & _
       (ctl.Width / objForm.ScaleWidth) & vbTab & (ctl.Height / objForm.ScaleHeight) & vbTab
       ctl.Tag = ctl.Tag & ctl.FontSize
    Next ctl
   
End Sub

Public Sub ResizeControlsMDI(objForm As Form)
'Resize Each Control on a form based on the
'ctl/form Aspect Ratios stored in the ctl Tag Property

    On Error Resume Next
    
   Const kLEFT As Integer = 0
   Const kTOP As Integer = 1
   Const kWIDTH As Integer = 2
   Const kHEIGHT As Integer = 3
   Const kFONTSIZE As Integer = 4
       
   Dim ctl As Control
   Dim strTag As String
   Dim LeftAspect As Double
   Dim TopAspect As Double
   Dim WidthAspect As Double
   Dim HeightAspect As Double
   Dim sngFontSize As Single
   'Dim strName As String
   Dim idx As Integer
  
   '----------
   
     'Extract the Aspect Ratio of each control from its tag property
     For Each ctl In objForm.Controls
     
'        strName = ctl.Name
        'Extract the Base Values from the Tag Property
        strTag = ctl.Tag
        LeftAspect = ParseAnyString(strTag, kLEFT, vbTab)
        TopAspect = ParseAnyString(strTag, kTOP, vbTab)
        WidthAspect = ParseAnyString(strTag, kWIDTH, vbTab)
        HeightAspect = ParseAnyString(strTag, kHEIGHT, vbTab)
        sngFontSize = ParseAnyString(strTag, kFONTSIZE, vbTab)
        
        'Resize the Control based on the Aspect Ratios
        ctl.Left = LeftAspect * objForm.ScaleWidth
        ctl.Top = TopAspect * objForm.ScaleHeight
        ctl.Width = WidthAspect * objForm.ScaleWidth
        ctl.Height = HeightAspect * objForm.ScaleHeight
        ctl.FontSize = sngFontSize
     Next ctl

     'RePaint
     idx = GetFormIndex(objForm)     '<<MCommon  (not provided)
     RePaintWindow (idx)             '<<MCommon  (not provided)
    
End Sub

Private Function ParseAnyString$(source$, ByVal idx%, ByVal sep$)
'ParseAnyString is an incredibly useful function for parsing strings
'that are divided by a separator.
'It Extracts the idx%'th string from source$, where the
'substrings are separated by character a sep$
'idx%= is the first string

    Dim nexttab%, basepos%, thispos%
    Dim res$
 
    '---------------

    basepos% = 1
    thispos% = 

    If (Len(source$) = ) Then
        ParseAnyString$ = ""
        Exit Function
    End If

    Do

        nexttab% = InStr(basepos%, source$, sep$)

        If nexttab% =  Then nexttab% = Len(source$) + 1

        'Now points to next tab or 1 past end of string

        'The following should never happen

        'If nexttab% = basepos% Then GoTo ptsloop1

        If thispos% = idx% Then

            If nexttab% - basepos% - 1 <  Then

                res$ = ""

            Else

                res$ = Mid$(source$, basepos%, nexttab% - basepos%)

            End If

            Exit Do

        End If

ptsloop1:

        basepos% = nexttab% + 1

        thispos% = thispos% + 1

    Loop While (basepos% <= Len(source$))

    ParseAnyString$ = res$

End Function